heshaofeng
7 天以前 ca3e4977395bc02c5d147dffdff7381333fdfbca
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -80,7 +80,8 @@
            _allocateOrderRepository = allocateOrderRepository;
        }
        public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
        public async Task<WebResponseContent>
            GroupPallet(GroupPalletDto palletDto)
        {
            WebResponseContent content = new WebResponseContent();
            try
@@ -152,7 +153,7 @@
                if(inboundOrder.BusinessType != "11")
                {
                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First();
                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => (x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode)&& x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()).Select(x => x.WarehouseCode).First();
                    if (string.IsNullOrEmpty(warehouseType))
                    {
@@ -180,6 +181,20 @@
                    stockInfo = new Dt_StockInfo() { PalletType = (int)PalletTypeEnum.None, LocationType = Convert.ToInt32(palletDto.locationType) };
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
                }
                //else
                //{
                //      var allowStatus = new[]
                //  {
                //      (int)StockStatusEmun.组盘暂存,
                //      (int)StockStatusEmun.智仓入智仓组盘暂存,
                //      (int)StockStatusEmun.手动组盘暂存
                //  };
                //    if (!allowStatus.Contains(stockInfo.StockStatus))
                //    {
                //        return content.Error($"该托盘{stockInfo.PalletCode}状态不允许组盘");
                //    }
                //}
                if (inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
                {
@@ -195,6 +210,10 @@
                {
                    return content.Error($"该单据为试产物料,需要入库到试产仓,请重新根据厂区选择试产仓库进行组盘入库");
                }
                if (inboundOrder.IsTestMaterials == 0 && (palletDto.WarehouseType == "1076" || palletDto.WarehouseType == "5057"))
                {
                    return content.Error($"该单据为非试产物料,不能入到试产仓,请重新根据仓库进行组盘入库");
                }
                if (!_locationInfoService.QueryLocationCount(Convert.ToInt32(palletDto.locationType)))
                {
                    return content.Error($"该库区{palletDto.locationType}不存在空闲库位");