wangxinhui
2025-12-31 edc7293bf81729ebaa2d7cdd9a1f3aeaf567f538
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -459,9 +459,9 @@
                        {
                            throw new Exception($"未找到入库单号为{inboundOrder.PurchaseOrderNo}条码{palletCode}单据信息");
                        }
                        if (inboundOrderDetail.PurchaseDetailWide < 690)
                        if (inboundOrderDetail.PurchaseDetailWide < 690 || inboundOrderDetail.PurchaseDetailWide > 2500)
                        {
                            return content.Error("新厂物料幅宽限制为690-2700mm");
                            return content.Error($"物料幅宽限制为690-2500mm,当前纸卷幅宽{inboundOrderDetail.PurchaseDetailWide}");
                        }
                        if (inboundOrderDetail.PurchaseDetailThickness <= 0)
                        {
@@ -509,7 +509,7 @@
                                BatchNo = inboundOrderDetail.MaterialLot,
                                StockLength = inboundOrderDetail.PurchaseDetailQuantity
                            };
                            if (inboundOrderDetail.PurchaseDetailWide > 1200)
                            if (inboundOrderDetail.PurchaseDetailWide >= 1160)
                            {
                                stockInfo.PalletType = 2;
                            }
@@ -554,9 +554,9 @@
                        {
                            throw new Exception($"未找到入库单号为{inboundOrder.UpperOrderNo}条码{palletCode}单据信息");
                        }
                        if (inboundOrderDetail.MaterialWide < 690)
                        if (inboundOrderDetail.MaterialWide < 690 || inboundOrderDetail.MaterialWide > 2500)
                        {
                            return content.Error("新厂物料幅宽限制为690-2700mm");
                            return content.Error($"物料幅宽限制为690-2500mm,当前纸卷幅宽{inboundOrderDetail.MaterialWide}");
                        }
                        if (inboundOrderDetail.MaterialThick <= 0)
                        {
@@ -604,7 +604,7 @@
                                BatchNo = inboundOrderDetail.MaterialLot,
                                StockLength = inboundOrderDetail.OrderQuantity
                            };
                            if (inboundOrderDetail.MaterialWide > 1200)
                            if (inboundOrderDetail.MaterialWide >= 1160)
                            {
                                stockInfo.PalletType = 2;
                            }
@@ -651,9 +651,11 @@
                        }
                        BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"一期ERP未返回{palletCode}的库存信息");
                        if (bSTStockInfoDTO.W < 690 || bSTStockInfoDTO.W > 2500)
                        {
                            return content.Error($"物料幅宽限制为690-2500mm,当前纸卷幅宽{bSTStockInfoDTO.W}");
                        }
                        Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == bSTStockInfoDTO.MaterialId) ?? throw new Exception($"未找到条码{palletCode}物料信息{bSTStockInfoDTO.MaterialNo}");
                        //生成库存组盘信息
                        Dt_StockInfo stockInfo = new Dt_StockInfo()
                        {
@@ -675,7 +677,7 @@
                            StockLength = bSTStockInfoDTO.StockMeter,
                            MaterielId = materielInfo.MaterialSourceId
                        };
                        if (bSTStockInfoDTO.W > 1200)
                        if (bSTStockInfoDTO.W >= 1160)
                        {
                            stockInfo.PalletType = 2;
                        }
@@ -729,6 +731,10 @@
                        }
                        else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt())
                        {
                            if (purchaseBSTOrderDetail.MaterialWide < 690 || purchaseBSTOrderDetail.MaterialWide > 2500)
                            {
                                return content.Error($"物料幅宽限制为690-2500mm,当前纸卷幅宽{purchaseBSTOrderDetail.MaterialWide}");
                            }
                            yLInboundCache = _mapper.Map<Dt_YLInboundCache>(purchaseBSTOrderDetail);
                            yLInboundCache.Id = Id;
                            //获取采购主单
@@ -756,7 +762,7 @@
                                StockLength = purchaseBSTOrderDetail.ProcurementLength,
                                MaterielId = purchaseBSTOrderDetail.MaterialId
                            };
                            if (purchaseBSTOrderDetail.MaterialWide > 1200)
                            if (purchaseBSTOrderDetail.MaterialWide >= 1160)
                            {
                                stockInfo.PalletType = 2;
                            }
@@ -1051,6 +1057,21 @@
                    _unitOfWorkManage.CommitTran();
                    //记录库存变动
                    _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum);
                    //上报新厂ERP
                    if (stockInfo.MaterielInvOrgId==MaterielInvOrgEnum.新厂.ObjToInt() && task.TaskType == TaskTypeEnum.Inbound.ObjToInt())
                    {
                        string request = _invokeERPService.ERPPurchaseUp(new ERPPurchaseUpModel()
                        {
                            INV_BARCODE_RFID = new List<INV_BARCODE_RFIDItem>()
                            {
                                new INV_BARCODE_RFIDItem()
                                {
                                    INV_BARCODE=stockInfo.PalletCode,
                                    RFID_BARCODE=stockInfo.RfidCode
                                }
                            }
                        });
                    }
                    //上报老厂ERP
                    if (stockInfo.MaterielInvOrgId == MaterielInvOrgEnum.老厂.ObjToInt() && task.TaskType == TaskTypeEnum.Inbound.ObjToInt())
                    {
@@ -1631,7 +1652,7 @@
                    MaterielCode = materielInfo.MaterielCode,
                    MaterielName = materielInfo.MaterielName,
                };
                if (wide > 1200)
                if (wide >= 1160)
                {
                    stockInfo.PalletType = 2;
                }
@@ -1717,7 +1738,7 @@
                    MaterielCode = materielInfo.MaterielCode,
                    MaterielName = materielInfo.MaterielName,
                };
                if (wide > 1200)
                if (wide >= 1160)
                {
                    stockInfo.PalletType = 2;
                }
@@ -1895,7 +1916,7 @@
                        MaterielName = materielInfo.MaterielName,
                        StockLength=item.ProQuantity
                    };
                    if (item.Wide > 1200)
                    if (item.Wide >= 1160)
                    {
                        stockInfo.PalletType = 2;
                    }