Administrator
2024-03-06 65ecd34acf0a3d33e6c1e10c93e351716d749e2f
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;
@@ -169,7 +177,7 @@
                        skuType = "(4)";
                        break;
                    case "7"://寄存入库
                        skuType = "(0,1,2,3,4)";
                        skuType = "(3)";
                        break;
                    default: //其它
                        skuType = "(0,1,2,3,4)";
@@ -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.ASNNo == notice.ASNNo && m.Status != "2").ToList();
                if (palletBind != null && palletBind.Count > 0)
                {
                    throw new Exception("存在未入库完成托盘信息,不允许关单");
                }
                var sqlString = "";
@@ -735,16 +752,35 @@
                    }
                    var info = boxInfo.First(m => m.BindNo == item.Id);
                    if (!msgS.Contains(info.SkuNo))
                    //获取托盘绑定对应单据
                    var noticeDetail = Db.Queryable<BllArrivalNoticeDetail>().First(a => a.IsDel == "0" && a.Id == item.ASNDetailNo);
                    if (info != null)
                    {
                        msgS += info.SkuNo + ";";
                    }
                        if (!msgS.Contains(info.SkuNo))
                        {
                            msgS += info.SkuNo + ";";
                        }
                    if (!msgL.Contains(info.LotNo))
                        if (!msgL.Contains(info.LotNo))
                        {
                            msgL += info.LotNo + ";";
                        }
                    }
                    else
                    {
                        msgL += info.LotNo + ";";
                        if (!msgS.Contains(noticeDetail.SkuNo))
                        {
                            msgS += noticeDetail.SkuNo + ";";
                        }
                        if (!msgL.Contains(noticeDetail.LotNo))
                        {
                            msgL += noticeDetail.LotNo + ";";
                        }
                    }
                }
                var time = DateTime.Now;
                var log = new BllAuditLog()
@@ -936,6 +972,10 @@
                {
                    throw new Exception("未查询到单据信息");
                }
                if (notice.Status != "3")
                {
                    throw new Exception("复核失败,单据非关闭状态");
                }
                var detail = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.ASNNo == notice.ASNNo && m.IsDel == "0").ToList();
                if (detail.Count == 0)
                {