dengjunjie
7 天以前 bc43fe34a67fa68bcfb3a51b79308fad0be11c08
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs
@@ -71,6 +71,7 @@
            WebResponseContent webResponseContent = new WebResponseContent();
            try
            {
                _unitOfWorkManage.BeginTran();
                Dt_Tactics tactics = _tacticsService.Repository.QueryFirst(x => x.TacticeName == "出库策略");
                #region ç‰¹æ®Šåº“房出库
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
@@ -98,7 +99,7 @@
                            Status = 2, // pad平库,无需同步
                        }).ToList()
                    };
                    BaseDal.Db.InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand();
                    BaseDal.Db.CopyNew().InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand();
                    #endregion
                    #region å¤„理库存、库存批次、添加出库任务
                    List<Dt_SupplyTask> supplyTasks = new List<Dt_SupplyTask>();
@@ -448,14 +449,17 @@
                        }
                    }
                    if (entityOrder.Details.Count > 0)
                        BaseDal.Db.InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand();
                        BaseDal.Db.CopyNew().InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand();
                    if (entityOrderLK.Details.Count > 0)
                        BaseDal.Db.InsertNav(entityOrderLK).Include(x => x.Details).ExecuteCommand();
                        BaseDal.Db.CopyNew().InsertNav(entityOrderLK).Include(x => x.Details).ExecuteCommand();
                    #endregion
                }
                _unitOfWorkManage.CommitTran();
                webResponseContent.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                webResponseContent.Error(ex.Message);
            }
            return webResponseContent;
@@ -468,6 +472,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                _unitOfWorkManage.BeginTran();
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
                string WareCodeLD = WarehouseEnum.冷冻库.ObjToInt().ToString("000");
                #region ç‰¹æ®Šåº“房
@@ -724,12 +729,15 @@
                            //Repository.AddData(entityOrder);
                            #endregion
                        }
                        return WebResponseContent.Instance.OK("成功");
                        //return WebResponseContent.Instance.OK("成功");
                    }
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK("成功");
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
@@ -744,7 +752,7 @@
            try
            {
                // 1️⃣ æŸ¥æ‰¾æŒ‡å®šæ‰¹æ¬¡ä¸Žç‰©æ–™çš„库存信息
                var batchInfo = BaseDal.Db.Queryable<Dt_Inventory_Batch>()
                var batchInfo = BaseDal.Db.CopyNew().Queryable<Dt_Inventory_Batch>()
                    .Where(x => x.BatchNo == batchNo && x.MaterielCode == goodsNo)
                    .First();
@@ -886,7 +894,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_DeliveryOrder? cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).Includes(x => x.Details).First();
                Dt_DeliveryOrder? cabinOrder = BaseDal.Db.CopyNew().Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).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).FirstOrDefault();
@@ -910,7 +918,7 @@
                    //_deliveryOrderDetailServices.Repository.DeleteAndMoveIntoHty(cabinOrderDetail, OperateTypeEnum.自动完成);
                }
                _deliveryOrderDetailServices.Repository.UpdateData(cabinOrderDetail);
                var cabinOrder1 = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == cabinOrder.Out_no && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type != "20").Includes(x => x.Details).First();
                var cabinOrder1 = BaseDal.Db.CopyNew().Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == cabinOrder.Out_no && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type != "20").Includes(x => x.Details).First();
                if (!cabinOrder1.Details.Where(x => x.OotDetailStatus != "已完成").Any())
                    cabinOrder.OutStatus = "已完成";
                Repository.UpdateData(cabinOrder);