liulijun
2026-03-12 fe256a7afaa132910875d3dc73783d9ab2d7ace5
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs
@@ -117,7 +117,7 @@
                    MaterielCode = materielInfo.MaterielCode,
                    MaterielName=materielInfo.MaterielName,
                };
                if (wide>1200)
                if (wide>=1160)
                {
                    stockInfo.PalletType = 2;
                }
@@ -155,10 +155,12 @@
                    BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(item.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>();
                    if (bSTResponse.Code == 500)
                    {
                        throw new Exception($"未找到条码{item.PalletCode}一期ERP库存不存在");
                        stockInfosDel.Add(item);
                        content.Message += $"条码{item.PalletCode}一期ERP库存已不存在,";
                        continue;
                    }
                    BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"一期ERP未返回{item.PalletCode}的库存信息");
                    if (item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter>0)
                    if (item.StockLength != bSTStockInfoDTO.StockMeter)
                    {
                        item.MaterielThickness = bSTStockInfoDTO.Thick;
                        item.MaterielWeight = bSTStockInfoDTO.Qty;
@@ -166,10 +168,6 @@
                        item.Remark = $"{item.StockLength}-{bSTStockInfoDTO.StockMeter}";
                        item.StockLength = bSTStockInfoDTO.StockMeter;
                        stockInfosUp.Add(item);
                    }
                    else if(item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter == 0)
                    {
                        stockInfosDel.Add(item);
                    }
                }
                //数据库操作
@@ -180,7 +178,7 @@
                    BaseDal.DeleteAndMoveIntoHty(stockInfosDel, App.User.UserId > 0 ? OperateTypeEnum.人工完成 : OperateTypeEnum.自动完成);
                }
                _unitOfWorkManage.CommitTran();
                content.OK("更新成功");
                content.OK();
            }
            catch (Exception ex)
            {
@@ -205,6 +203,14 @@
            return BaseDal.GetStockInfos(materielCode, width, locationCodes);
        }
        /// <summary>
        /// èŽ·å–è€åŽ‚ç¼“å­˜å¯ç”¨åº“å­˜
        /// </summary>
        /// <returns></returns>
        public List<Dt_StockInfo> GetUseOldCacheStocks(string materielCode, decimal width)
        {
            return Db.Queryable<Dt_StockInfo>().Where(x => x.MaterielCode.StartsWith(materielCode) && x.StockStatus == StockStatusEmun.老厂退料暂存.ObjToInt() && x.MaterielWide == width && x.StockOutLength <= 0 && x.StockLength > 0).OrderBy(x => x.CreateDate).ToList();
        }
        public List<Dt_StockInfo> GetUseableStocks(string materielCode, int warehoseId)
        {
            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(warehoseId);