bklLiudl
2024-08-28 260c6e54c4f100ca49376a6afd70f73843868171
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -892,7 +892,7 @@
                #endregion
                #region 地码信息(储位信息)
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
                if (storageLocat == null)
                {
                    strMsg = "-1:储位信息不存在或非空闲状态,请核查!";
@@ -4582,6 +4582,18 @@
            var bindId = 0;
            if (bind == null)
            {
                DateTime? pTime = null;
                DateTime? eTime = null;
                if (!string.IsNullOrWhiteSpace(detail.Lot1))
                {
                    pTime = DateTime.Parse(detail.Lot1);
                }
                if (!string.IsNullOrWhiteSpace(detail.Lot2))
                {
                    eTime = DateTime.Parse(detail.Lot2);
                }
                bind = new BllPalletBind
                {
                    ASNNo = model.AsnNo,
@@ -4597,6 +4609,8 @@
                    SupplierLot = detail.SupplierLot,
                    //InspectMark = model.IsSample,      //是否取样托盘  后期业务开发时 接口传值需添加对应字段判断
                    //SamplingQty = 0,     //取样数量  后期业务开发时 接口传值需添加对应字段判断
                    ProductionTime = pTime,
                    ExpirationTime = eTime,
                    BitPalletMark = "1",
                    IsBale = "0",
                    IsBelt = "0",
@@ -4652,6 +4666,12 @@
            }
            else
            {
                string inspectStatusStr = "0";
                if (sku.IsInspect == "1")
                {
                    inspectStatusStr = "1";
                }
                // 库存不存在 插入数据
                sd1 = new DataStockDetail()
                {
@@ -4680,7 +4700,7 @@
                    ExpirationTime = bind.ExpirationTime,
                    Status = "0",
                    InspectMark = bind.InspectMark,
                    InspectStatus = sku.IsInspect,
                    InspectStatus = inspectStatusStr,
                    BitPalletMark = bind.BitPalletMark,
                    PackagNo = detail.PackagNo,                    //liudl 由sku的包装编号变为入库单明细的包装编码       
                    IsBale = bind.IsBale,
@@ -4870,9 +4890,6 @@
            sqlStr += $"insert into LogPalletTrack values('{model.PalletNo}','{model.AsnNo}','组盘','0',getDate(),{userId},NULL,NULL);";
            Db.Ado.ExecuteCommand(sqlStr);
            new OperationASNServer().AddLogOperationAsn("PDA模块", "托盘绑定", model.AsnNo, "添加", $"添加了托盘码为:{model.PalletNo}的组盘信息", userId);
        }
        #endregion
@@ -4922,7 +4939,7 @@
                #endregion
                #region 地码信息(储位信息)
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
                if (storageLocat == null)
                {
                    throw new Exception("储位信息不存在或非空闲状态,请核查!");
@@ -5263,7 +5280,9 @@
                    foreach (var item in stockDetail)
                    {
                        item.Status = "0"; //状态更改为待分配
                        item.WareHouseNo = "W02"; //所属仓库
                        item.WareHouseNo = storageLocat.WareHouseNo;        // 所属仓库
                        item.RoadwayNo = storageLocat.RoadwayNo;            // 所属巷道
                        item.AreaNo = storageLocat.AreaNo;                  // 所属区域
                        item.LocatNo = model.LocatNo;//储位地址
                        item.UpdateTime = serverTime; //修改时间
                        item.UpdateUser = model.CreateUser; //修改人
@@ -5304,10 +5323,12 @@
                    };
                    Db.Insertable(exTask).ExecuteCommand();
                    //托盘绑定信息
                    var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
                    var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo
                    && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
                    if (bindInfo != null)
                    {
                        bindInfo.WareHouseNo = "W02";//所属仓库
                        bindInfo.WareHouseNo = storageLocat.WareHouseNo;            // 所属仓库
                        bindInfo.RoadwayNo = storageLocat.RoadwayNo;                // 所属巷道
                        bindInfo.LocatNo = model.LocatNo;//储位地址
                        bindInfo.UpdateTime = serverTime;
                        bindInfo.UpdateUser = model.CreateUser;
@@ -5344,7 +5365,8 @@
                //修改储位信息                                        
                Db.Updateable(storageLocat).ExecuteCommand();
                new OperationASNServer().AddLogOperationAsn("PDA模块", "平库入库", model.PalletNo, "完成", $"在PDA上完成单据号为:{model.ASNNo}的托盘码为:{model.PalletNo}的平库入库操作", (int)model.CreateUser);
                new OperationASNServer().AddLogOperationAsn("PDA模块", "平库入库", model.PalletNo, "完成",
                    $"在PDA上完成单据号为:{model.ASNNo}的托盘码为:{model.PalletNo}的平库入库操作", (int)model.CreateUser);
                Db.CommitTran();
            }
            catch (Exception ex)