chengsc
2025-03-05 983cb777c4bfea428b9802b21b2eb9787f988946
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1187,10 +1187,10 @@
                {
                    throw new Exception("该托盘已有储位信息,请核实!");
                }
                if (stockDetail != null && (stockDetail.SkuNo != detail.SkuNo || stockDetail.LotNo != model.LotNo))
                {
                    throw new Exception("该托盘在库存已有其它物料批次信息,请核实!");
                }
                //if (stockDetail != null && (stockDetail.SkuNo != detail.SkuNo || stockDetail.LotNo != model.LotNo))
                //{
                //    throw new Exception("该托盘在库存已有其它物料批次信息,请核实!");
                //}
                #endregion
@@ -1589,13 +1589,11 @@
        {
            try
            {
                var item = Expressionable.Create<BllArrivalNoticeDetail>()
                .AndIF(true, it => it.IsDel == "0")
                .ToExpression();//注意 这一句 不能少
                var modelList = Db.Queryable<BllArrivalNoticeDetail>().Where(item)
                    .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo && tb2.IsDel == "0" && (tb1.Status == "0" || tb1.Status == "1"))
                    .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo && tb3.IsDel == "0" && tb3.IsPasteCode == "1")
                var modelList = Db.Queryable<BllArrivalNoticeDetail>()
                    .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo )
                    .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo )
                    .Where((tb1, tb2, tb3) => tb1.IsDel == "0" && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1") && tb3.IsDel == "0" && tb3.IsPasteCode == "1")
                    .Select((tb1, tb2, tb3) => tb1.ASNNo).Distinct().ToList();
                return modelList;
@@ -1613,13 +1611,11 @@
        {
            try
            {
                var item = Expressionable.Create<BllArrivalNoticeDetail>()
                .AndIF(true, it => it.IsDel == "0")
                .ToExpression();//注意 这一句 不能少
                var modelList = Db.Queryable<BllArrivalNoticeDetail>().Where(item)
                     .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1"))
                     .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo && tb3.IsDel == "0" && tb3.IsPasteCode == "0")
                var modelList = Db.Queryable<BllArrivalNoticeDetail>()
                     .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo )
                     .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo )
                     .Where((tb1, tb2, tb3) => tb1.IsDel == "0" && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1") && tb3.IsDel == "0" && tb3.IsPasteCode == "0")
                     .Select((tb1, tb2, tb3) => tb1.ASNNo).Distinct().ToList();
                return modelList;
@@ -1859,6 +1855,49 @@
            }
        }
        /// <summary>
        /// 验证托盘是否存在
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <returns>"":可使用 -1:不可使用(原因)</returns>
        public string IsEnablePalletNo(string palletNo)
        {
            string sqlMsg = "";
            string sqlString = string.Empty;
            try
            {
                sqlString = $"select * from SysPallets where PalletNo = '{palletNo}' and isdel = '0';";
                var models = Db.Ado.SqlQuery<PalletBindVm>(sqlString);
                if (models.Count > 1)
                {
                    sqlMsg = "-1:存在重复托盘号,请检查!";
                    return sqlMsg;
                }
                if (models.Count > 0)
                {
                    if (models[0].Status == "1")
                    {
                        sqlString = $"select count(id) from DataStockDetail where PalletNo = '{palletNo}' and isnull(LocatNo,'') != '' and isdel = '0';";
                        int rowNum = Db.Ado.GetInt(sqlString);
                        if (rowNum > 0)
                        {
                            sqlMsg = "-1:托盘使用中,此托盘应在库内请核实!";
                        }
                    }
                }
                else
                {
                    sqlMsg = "-1:托盘号不存在!";
                }
                return sqlMsg;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion
@@ -1906,49 +1945,7 @@
       
        /// <summary>
        /// 验证托盘是否存在
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <returns>"":可使用 -1:不可使用(原因)</returns>
        public string IsEnablePalletNo(string palletNo)
        {
            string sqlMsg = "";
            string sqlString = string.Empty;
            try
            {
                sqlString = $"select * from SysPallets where PalletNo = '{palletNo}' and isdel = '0';";
                var models = Db.Ado.SqlQuery<PalletBindVm>(sqlString);
                if (models.Count > 1)
                {
                    sqlMsg = "-1:存在重复托盘号,请检查!";
                    return sqlMsg;
                }
                if (models.Count > 0)
                {
                    if (models[0].Status == "1")
                    {
                        sqlString = $"select count(id) from DataStockDetail where PalletNo = '{palletNo}' and isnull(LocatNo,'') != '' and isdel = '0';";
                        int rowNum = Db.Ado.GetInt(sqlString);
                        if (rowNum > 0)
                        {
                            sqlMsg = "-1:托盘使用中,此托盘应在库内请核实!";
                        }
                    }
                }
                else
                {
                    sqlMsg = "-1:托盘号不存在!";
                }
                return sqlMsg;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        // 根据箱码或托盘号获取箱支信息   liudl 
        public List<BoxInfoDto> GetBoxInfos(BoxInfoVm model)