admin
8 天以前 657a052c5ec133abd43ab397d679304a1a8a61e3
Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs
@@ -80,7 +80,7 @@
                skuname = "%" + model.SkuName + "%", //物料名称
                lotno = model.LotNo, //批次号
                isqualified = model.IsQualified, //是否合格
                origin=model.Origin//来源
                origin = model.Origin//来源
            });
            return qualityList;
        }
@@ -166,7 +166,7 @@
            {
                sqlStr += $" and LotNo='{model.LotNo}' ";
            }
            BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First();
            BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First();
            if (arrivalDetail == null)
            {
                throw new Exception("未找到入库单信息!");
@@ -195,7 +195,7 @@
            List<DataStockDetail> detail = Db.SqlQueryable<DataStockDetail>(sqlStr2).ToList();
            foreach (var item in detail)
            {
                List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList();
                //List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList();
                //判断合格状态是否合格
                if (model.IsQualified == "1")
                {
@@ -211,12 +211,17 @@
                    item.InspectStatus = "2"; //2不合格
                }
                Db.Updateable(box).ExecuteCommand();
                //Db.Updateable(box).ExecuteCommand();
                Db.Updateable(item).ExecuteCommand();
            }
            Db.Updateable(arrivalDetail).ExecuteCommand();
            var isquality = Db.Insertable(model).ExecuteCommand();
            //修改库存箱码质检状态
            string uptDataBoxStatusSql = $@"update DataBoxInfo set InspectStatus='1' where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and StockDetailId in (select Id from DataStockDetail where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and InspectStatus='1') ";
            int uptDataBoxStatus = Db.Ado.ExecuteCommand(uptDataBoxStatusSql);
            return isquality;
        }
@@ -457,7 +462,7 @@
                //回滚事务
                Db.RollbackTran();
                //抛出异常
                throw new Exception("接收SAP下发库存调整单异常:", ex);
                throw new Exception($"接收SAP下发库存调整单异常:{ex}");
            }
        }
        #endregion