wangxinhui
2026-03-31 7803a1f8d35c9b80ae07f14c60f871a74a5aebd6
ÏîÄ¿´úÂë/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)
@@ -964,6 +974,10 @@
                if (count != null)
                {
                    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 ?? "";
@@ -2059,7 +2073,7 @@
                        NextAddress = "",
                        PalletCode = item.BarCode,
                        Roadway = "",
                        SourceAddress = CheckPointCode.AGVStationCode,
                        SourceAddress = item.PointCode.StartsWith("YS") ? CheckPointCode.AGVStationCode : CheckPointCode.MESPointCode,
                        TargetAddress = "",
                        TaskType = 0,
                        TaskStatus = TaskStatusEnum.New.ObjToInt(),