bklLiudl
2024-02-20 8fd50971e486a66b6254b99374e6f8db34f9d7df
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -2110,22 +2110,6 @@
                Db.BeginTran();//开启事务
                if (iscount == 0)//正常入库
                {
                    #region 箱码信息
                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
                    //验证箱码信息是否存在
                    if (boxInfoList.Count <= 0)
                    {
                        throw new Exception("箱码信息不存在,请核查!");
                    }
                    foreach (var item in boxInfoList)
                    {
                        item.Status = "2"; // 改变箱支关系表状态:已入库
                        item.UpdateTime = serverTime;
                        item.UpdateUser = model.CreateUser;
                    }
                    Db.Updateable(boxInfoList).ExecuteCommand();
                    #endregion
                    #region 入库总单信息
                    var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo);
                    //验证入库单总单是否关闭
@@ -2137,6 +2121,30 @@
                    if (notice.Status == "3")
                    {
                        throw new Exception("入库单总单已关闭,请核查!");
                    }
                    #endregion
                    #region 箱码信息
                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
                    // type 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                    if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7")
                    {
                        // 不贴码物料 无需验证箱码信息
                    }
                    else
                    {
                        //验证箱码信息是否存在
                        if (boxInfoList.Count <= 0)
                        {
                            throw new Exception("箱码信息不存在,请核查!");
                        }
                        foreach (var item in boxInfoList)
                        {
                            item.Status = "2"; // 改变箱支关系表状态:已入库
                            item.UpdateTime = serverTime;
                            item.UpdateUser = model.CreateUser;
                        }
                        Db.Updateable(boxInfoList).ExecuteCommand();
                    }
                    #endregion
@@ -2228,7 +2236,7 @@
                            ASNDetailNo = (int)bindInfo.ASNDetailNo,
                            WareHouseNo = "W02",
                            RoadwayNo = "",
                            AreaNo = "",
                            AreaNo = storageLocat.AreaNo,
                            LocatNo = model.LocatNo,
                            PalletNo = model.PalletNo,
                            PalletNo2 = bindInfo.PalletNo2,
@@ -2253,6 +2261,7 @@
                    {
                        stId = detailModel.Id;
                        detailModel.LocatNo = model.LocatNo;
                        detailModel.AreaNo = storageLocat.AreaNo;
                        detailModel.UpdateTime = serverTime;
                        detailModel.UpdateUser = (int)model.CreateUser;
                        // 变更储位地址