yanjinhui
2025-11-19 02e4718a9a3f03e2385d4e26ffbedf1ceb89908e
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs
@@ -12,6 +12,7 @@
using System.Transactions;
using WIDESEA_Common;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.MaterielEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
@@ -142,6 +143,15 @@
                cabinOrderDetail.Order_Inqty += Inqty;
                if (cabinOrderDetail.Order_Inqty > cabinOrderDetail.Order_qty)
                    return WebResponseContent.Instance.Error($"入库数量不可超出单据数量");
                //大件库整箱校验
                if (warehouseCode == WarehouseEnum.大件库.ObjToInt().ToString("000")&& (materielInfo.MaterielSourceType==MaterielSourceTypeEnum.SelfMadePart))
                {
                    var BoxRule = materielInfo.BoxQty;
                    if (BoxRule > 0 && Inqty % BoxRule != 0)
                    {
                        return WebResponseContent.Instance.Error($"大件库只允许存放整箱货物!当前入库数量 {Convert.ToInt32(Inqty)} ä¸æ˜¯ç®±è§„ {Convert.ToInt32(BoxRule)} çš„æ•´æ•°å€");
                    }
                }
                #region å¤„理入库单,货位,库存,库存批次信息
                _unitOfWorkManage.BeginTran();
@@ -162,6 +172,7 @@
                #region è´§ä½
                var location = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
                if (location == null) return WebResponseContent.Instance.Error($"请维护货位编号【{LocationCode}】的货位信息");
                //if (location.EnableStatus == EnableStatusEnum.Disable.ObjToInt())
                //    return WebResponseContent.Instance.Error($"货位编号【{LocationCode}】已禁用,请恢复正常再使用");
                if (location.WarehouseCode != cabinOrderDetail.Reservoirarea)
@@ -321,6 +332,16 @@
            {
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
                string WareCodeLD = WarehouseEnum.冷冻库.ObjToInt().ToString("000");
                #region æ£€æŸ¥æ˜¯å¦æœ‰æœªå®Œæˆçš„盘点任务
                var dt_bath = _inventory_BatchServices.Repository.QueryData(x => order.details.Select(d => d.goods_no).Contains(x.MaterielCode)).ToList();
                if (dt_bath.Count>=1)
                {
                    foreach (var item in dt_bath)
                    {
                        if (item.SupplyQuantity > 0) throw new Exception($"入库单【{order.order_no}】物料编号【{dt_bath[0].MaterielCode}】存在未完成的盘盈入库任务,请处理完成后再进行正常入库操作");
                    }
                }
                #endregion
                List<Dt_CabinOrder> dt_CabinOrders = new List<Dt_CabinOrder>();
                #region ç‰¹æ®Šè¯å“å…¥ç‰¹æ®Šåº“房
                if (order.warehouse_no == WareCodeMJ || order.warehouse_no == WareCodeLD)
@@ -1156,7 +1177,8 @@
            }
            catch (Exception ex)
            {
                throw ex;
                //throw ex;
                return content.Error(ex.Message);
            }
            //return content;
            return content.OK($"盘盈入库单创建成功");