yuyou_x
2024-03-26 5b4f00ff3ea04a3246a8f6f86bdefe749fcfd0c4
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -506,7 +506,8 @@
                    SkuName = it.SkuName,
                    LotNo = it.LotNo,
                    Standard = it.Standard,
                    Qty = type == "4" ? it.Qty : it.Qty - it.LockQty - it.FrozenQty
                    //Qty = type == "4" ? it.Qty : it.Qty - it.LockQty - it.FrozenQty,
                    Qty = it.Qty - it.LockQty - it.FrozenQty,
                }).ToList();
@@ -2548,6 +2549,38 @@
                    {
                        throw new Exception("未查询到任务信息");
                    }
                    //获取对应库位信息
                    var startlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
                    if (startlocat == null)
                    {
                        throw new Exception("未查询到储位信息");
                    }
                    startlocat.Status = "0";//修改分配信息状态
                    //获取储位信息
                    var locat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
                    //获取移库任d务对应目标储位信息
                    SysStorageLocat endlocat = new SysStorageLocat();
                    if (task.Type == "2")
                    {
                        endlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.EndLocat);
                        if (endlocat == null)
                        {
                            throw new Exception("未查询到目标储位信息");
                        }
                    }
                    if (locat == null)
                    {
                        Db.RollbackTran();
                        throw new Exception("未查询到储位信息,请核实!");
                    }
                    locat.Status = "1"; //有物品
                    Db.Updateable(locat).ExecuteCommand();
                    if (endlocat != null)
                    {
                        endlocat.Status = "0"; //空储位 0
                        Db.Updateable(endlocat).ExecuteCommand();
                    }
                    //修改任务 
                    task.IsSuccess = 1;
                    task.IsSend = 0;
@@ -2571,31 +2604,6 @@
                        noticeDetail.FactQty -= item.Qty; //修改出库单明细的下架数量
                        Db.Updateable(noticeDetail).ExecuteCommand();
                        //获取储位信息
                        var locat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
                        //获取移库任务对应目标储位信息
                        SysStorageLocat endlocat = new SysStorageLocat();
                        if (task.Type == "2")
                        {
                            endlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W03" && a.LocatNo == task.EndLocat);
                            if (endlocat == null)
                            {
                                throw new Exception("未查询到目标储位信息");
                            }
                        }
                        if (locat == null)
                        {
                            Db.RollbackTran();
                            throw new Exception("未查询到储位信息,请核实!");
                        }
                        locat.Status = "1"; //有物品
                        Db.Updateable(locat).ExecuteCommand();
                        if (endlocat != null)
                        {
                            endlocat.Status = "0"; //空储位 0
                            Db.Updateable(endlocat).ExecuteCommand();
                        }
                        if (noticeDetail.FactQty == 0)
                        {