wangxinhui
2026-03-23 531c6e89dc07bb6997e6249a6cd9f53a9bd474a5
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -365,9 +365,14 @@
                    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;
                if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight)
                decimal errWeight = Math.Abs(weight - bSTStockInfoDTO.Qty);
                if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight && errWeight <= AppSettings.Get("ErrWeight").ObjToInt())
                {
                    Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == stockInfoOld.MaterielId);
                    int gramWeight = (int)(materielInfo.MaterielWeight * 1000);
@@ -376,7 +381,7 @@
                        Paper_code = stockInfoOld.PalletCode,
                        Estimate_weight = bSTStockInfoDTO.Qty,
                        Actual_weight = weight,
                        Error_weight = Math.Abs(weight - bSTStockInfoDTO.Qty),
                        Error_weight = errWeight,
                        Weigh_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                        Operator = "LiKu",
                        Width = bSTStockInfoDTO.W,
@@ -397,6 +402,11 @@
                stockInfoOld.StockLength = stockLength;
                stockInfoOld.StockOutLength = 0;
                stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt();
                List<Dt_OutLineView> outLineViewsDel = _outboundRepository.OutLineViewRepository.QueryData(x=>x.PalletCode==stockInfoOld.PalletCode);
                if (outLineViewsDel.Count>0)
                {
                    _outboundRepository.OutLineViewRepository.DeleteData(outLineViewsDel);
                }
                content.OK("成功",data:stockInfoOld);
            }
            catch (Exception ex)
@@ -965,6 +975,10 @@
                {
                    item.Count -= count.Count;
                }
                if (item.Count >= 50 && count?.Count<=2)
                {
                    return item.RoadwayNo;
                }
            }
            return locationCounts.Where(x => x.Count > 0).OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? "";
        }