wxw
8 天以前 3ffc9e207b22b4fff12e601aeb512b8d373e5a9d
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -1097,7 +1097,7 @@
                    skuList = skuList.Where(m => m.SkuNo == "100088").ToList();
                }
                skuStrList = skuList.Select(m => m.SkuNo).ToList();
                var areaStr = new List<string>() { "B06", "B07", "B09" };
                var areaStr = new List<string>() { "B06", "B07", "B09", "B24" };
                var stockRst = new StockServer();
                var stockDetailRst = new StockDetailServer();
                Expression<Func<DataStockDetail, bool>> item = Expressionable.Create<DataStockDetail>()
@@ -1194,6 +1194,12 @@
                        //}
                        break;
                    case "W02"://原料库
                        if (skuList.Any(m => m.Type == "2"))
                        {
                            throw new Exception("仓库与出库物料不符");
                        }
                        break;
                    case "W04"://平库
                        if (skuList.Any(m => m.Type == "2"))
                        {
                            throw new Exception("仓库与出库物料不符");
@@ -2774,7 +2780,8 @@
                        //取合适库存商品
                        Dictionary<int, decimal> stockQtyDic = new Dictionary<int, decimal>();//托出库物品数
                        var qty = 0m;
                        var qty = 0m;//分配数量
                        var xQty = 0m;//下架数量
                        var house = "";
                        //分配货物
@@ -2810,6 +2817,11 @@
                                CreateUser = userId,
                                CreateTime = DateTime.Now
                            };
                            if (s.WareHouseNo == "W04")
                            {
                                allot.Status = "2";//待拣货
                                xQty += allot.Qty;
                            }
                            exAllotList.Add(allot);
                            s.LockQty += stockQtyDic[s.Id];
@@ -2826,7 +2838,8 @@
                            var sd = Db.Updateable(s).UpdateColumns(it => new { it.LockQty, it.Status }).ExecuteCommand();
                        }
                        detail.AllotQty += qty;
                        detail.AllotQty += qty;//分配数量
                        detail.FactQty += xQty;//下架数量
                        detail.UpdateUser = userId;
                        detail.UpdateTime = DateTime.Now;
                        if (detail.Status == "0")
@@ -2892,8 +2905,13 @@
                                //证明所有分配数量全部小于等于出库数量 不做修改
                                break;
                        }
                        var outPalletCount = exAllotList.Where(w => w.Status == "0").Count();//查找有无需要出库的托盘
                        if (outPalletCount <= 0)
                        {
                            notice.Status = "3";//正在执行
                    }
                    }
                    notice.UpdateUser = userId;
                    notice.UpdateTime = DateTime.Now;
                    var zd = Db.Updateable(notice).ExecuteCommand();
@@ -3005,6 +3023,7 @@
                            soDetailList.Add(soDetail);
                        }
                        d.AllotQty = 0;
                        d.FactQty = 0;
                        d.Status = "0";
                        d.UpdateUser = userId;
                        d.UpdateTime = DateTime.Now;
@@ -3210,7 +3229,8 @@
                //var stockz = Db.Queryable<DataStock>().First(d => d.IsDel == "0" && d.SkuNo == detail.SkuNo && d.LotNo == detail.LotNo);
                var allotList = new List<BllExportAllot>();
                decimal outQtys = 0;
                decimal outQtys = 0;//分配数量
                decimal xQty = 0;//下架数量
                foreach (var st in model.StockList)
                {
                    var stock = stockList.First(a => a.Id == st.StockId);
@@ -3252,6 +3272,11 @@
                            CreateUser = userId,
                            CreateTime = DateTime.Now
                        };
                        if (stock.WareHouseNo == "W04")
                        {
                            allot.Status = "2";//待拣货
                            xQty += allot.Qty;
                        }
                        allotList.Add(allot);
                    }
                    else
@@ -3274,7 +3299,8 @@
                }
                Db.Insertable(allotList).ExecuteCommand();
                //修改单据明细
                detail.AllotQty += outQtys;
                detail.AllotQty += outQtys;//分配数量
                detail.FactQty += xQty;//下架数量
                detail.UpdateUser = userId;
                detail.UpdateTime = DateTime.Now;
                if (detail.Status == "0")
@@ -3304,6 +3330,12 @@
                    {
                        notice.Status = "1";//证明分配数量小于等于出库数量  修改为部分分配
                    }
                    var outPalletCount = allotList.Where(w => w.Status == "0").Count();//查找有无需要出库的托盘
                    if (outPalletCount <= 0)
                    {
                        notice.Status = "3";//正在执行
                    }
                    Db.Updateable(notice).ExecuteCommand();
                }
                //添加操作日志记录