yanjinhui
2025-10-26 e1383d0a6ee0558c34f013f4e2561063bc2353b3
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs
@@ -44,7 +44,7 @@
                            Dt_DeliveryOrder deliveryOrder = new Dt_DeliveryOrder()
                            {
                                Out_no = item.MaterielCode + "_" + item.BatchNo,
                                Out_type = "3",
                                Out_type = "20",
                                OutStatus = "新建",
                                Warehouse_no = items.Key,
                                Details = new List<Dt_DeliveryOrderDetail>()
@@ -133,11 +133,11 @@
                List<Dt_DeliveryOrder> dt_ReceiveOrders = new List<Dt_DeliveryOrder>();
                if (string.IsNullOrEmpty(orderNo))
                {
                    dt_ReceiveOrders = Db.Queryable<Dt_DeliveryOrder>().Where(x => (x.OutStatus == "新建" || x.OutStatus == "开始") && x.Warehouse_no == warehouseCode && x.Out_type == "3").Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5);
                    dt_ReceiveOrders = Db.Queryable<Dt_DeliveryOrder>().Where(x => (x.OutStatus == "新建" || x.OutStatus == "开始") && x.Warehouse_no == warehouseCode && x.Out_type == "20").Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5);
                }
                else
                {
                    dt_ReceiveOrders = Db.Queryable<Dt_DeliveryOrder>().Where(x => (x.Out_no.Contains(orderNo) || x.Client_no.Contains(orderNo)) && (x.OutStatus == "新建" || x.OutStatus == "开始") && x.Out_type == "3" && x.Warehouse_no == warehouseCode).OrderByDescending(x => x.CreateDate).Includes(x => x.Details).ToPageList(pageNo, 5);
                    dt_ReceiveOrders = Db.Queryable<Dt_DeliveryOrder>().Where(x => (x.Out_no.Contains(orderNo) || x.Client_no.Contains(orderNo)) && (x.OutStatus == "新建" || x.OutStatus == "开始") && x.Out_type == "20" && x.Warehouse_no == warehouseCode).OrderByDescending(x => x.CreateDate).Includes(x => x.Details).ToPageList(pageNo, 5);
                }
                content.OK(data: dt_ReceiveOrders);
@@ -218,13 +218,20 @@
            try
            {
                supplyTask.TaskStatus = SupplyStatusEnum.CheckFinish.ObjToInt();
                Dt_DeliveryOrder cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type == "3").Includes(x => x.Details).First();
                Dt_DeliveryOrder cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type == "20").Includes(x => x.Details).First();
                if (cabinOrder == null) return WebResponseContent.Instance.Error($"盘点单已完成");
                Dt_DeliveryOrderDetail cabinOrderDetail = cabinOrder.Details.Where(x => x.Batch_num == supplyTask.BatchNo && x.Reservoirarea == supplyTask.WarehouseCode && x.Goods_no == supplyTask.MaterielCode).First();
                if (cabinOrderDetail == null) return WebResponseContent.Instance.Error($"盘点单明细已完成");
                Dt_MaterielInfo materielInfo = _basicService.MaterielInfoService.Repository.QueryFirst(x => x.MaterielCode == cabinOrderDetail.Goods_no);
                if (materielInfo == null) return WebResponseContent.Instance.Error($"请维护物料编号【{cabinOrderDetail.Goods_no}】的物料信息");
                cabinOrderDetail.Order_Outqty += supplyTask.SupplyQuantity;
                #region å¹³åº“盘点只能出现整箱差异
                if (supplyTask.WarehouseCode == WarehouseEnum.大件库.ObjToInt().ToString())
                {
                    var Qty = supplyTask.SupplyQuantity % materielInfo.BoxQty;
                    if (Qty != 0) return WebResponseContent.Instance.Error($"大件库库存为整箱!盘点数量不能存在散件");
                }
                #endregion
                //if (cabinOrderDetail.Order_Outqty > cabinOrderDetail.Order_qty)
                //    return WebResponseContent.Instance.Error($"实盘数量不可超出账面数量");
@@ -268,8 +275,10 @@
                    {
                        x.OotDetailStatus = "已完成";
                    });
                    Repository.DeleteAndMoveIntoHty(cabinOrder, OperateTypeEnum.自动完成);
                    _deliveryOrderDetailServices.Repository.DeleteAndMoveIntoHty(cabinOrder.Details, OperateTypeEnum.自动完成);
                    cabinOrder.Details = null;
                    Repository.DeleteAndMoveIntoHty(cabinOrder, OperateTypeEnum.自动完成);
                    #endregion
                }
                supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == supplyTask.MaterielCode && x.BatchNo == supplyTask.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
@@ -297,7 +306,7 @@
                        inventory_Batch.SupplyQuantity = SupplyQuantitys;
                        _inventory_BatchServices.UpdateData(inventory_Batch);
                    }
                #endregion
                    #endregion
                }
                _unitOfWorkManage.CommitTran();