yuyou_x
2024-02-21 a339e5234e6299d32672aaae648e5315900c2633
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -156,12 +156,20 @@
                switch (model.Type)//0:原料 1:包材 2:成品 3:耗材 4:半成品
                {
                    case "0"://成品入库
                        skuType = "(2)";
                        break;
                    case "3"://退货入库
                        skuType = "(2)";
                        break;
                    case "5"://其它入库
                        skuType = "(0,1,3)";
                        break;
                    case "6"://代储入库
                        skuType = "(2)";
                        break;
                    case "1"://采购入库
                        skuType = "(0,1,3)";
                        break;
                    case "4"://车间余料退回入库
                        skuType = "(0,1,3)";
                        break;
@@ -353,8 +361,10 @@
            {
                //判断是否为采购入库单据或车间余料退回入库
                // 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                int isType = 0;
                if (model.Type == "1" || model.Type == "4")
                {
                    isType = 1;
                    if (!string.IsNullOrWhiteSpace(model.LotNo))
                    {
                        strMessage = "-1:采购入库或余料退回不可输入批次,不可编辑;";
@@ -415,7 +425,7 @@
                        strMessage = "-1:数量必须大于0;";
                        continue;
                    }
                    if (string.IsNullOrEmpty(detailModel.LotNo))
                    if (string.IsNullOrEmpty(detailModel.LotNo) && isType != 1)
                    {
                        strMessage = "-1:批次号不可为空;";
                        continue;
@@ -533,6 +543,7 @@
                //判断是否为采购入库单据或车间余料退回入库
                // 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库
                int notdel = 0;
                if (model.Type == "1" || model.Type == "4")
                {
                    //获取单据生成对应标签
@@ -548,10 +559,11 @@
                    sqlString += $"UPDATE BllBoxInfo SET IsDel = '1',";
                    sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                    sqlString += $"WHERE ASNNo = '{model.ASNNo}';";
                    notdel = 1;
                }
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                if (rowCount < 3)
                if (rowCount < 2 + notdel)
                {
                    Db.RollbackTran();
                    return "-1:删除失败!";
@@ -639,6 +651,11 @@
                //{
                //    throw new Exception("参数异常,请检查状态是否为执行完成");
                //}
                var palletBind = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.Status != "2").ToList();
                if (palletBind != null && palletBind.Count > 0)
                {
                    throw new Exception("存在未入库完成托盘信息,不允许关单");
                }
                var sqlString = "";