From dbbee893b65b5bd8ab47cb8f46fac0fdbcfeeb05 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Thu, 19 Oct 2023 10:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E7=9C=8B=E6=9D=BF=E9=9B=B6?= =?UTF-8?q?=E4=BB=B6=E5=8F=B7=E5=B7=B2=E7=BB=8F=E4=BD=9C=E5=BA=9F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=8F=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/SCP_ASN_CONTROLLER.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Controller/SCP_ASN_CONTROLLER.cs b/Controller/SCP_ASN_CONTROLLER.cs index 5d137f1..8146007 100644 --- a/Controller/SCP_ASN_CONTROLLER.cs +++ b/Controller/SCP_ASN_CONTROLLER.cs @@ -3108,18 +3108,22 @@ namespace CK.SCP.Controller } p_entitys.ForEach(itm => { - - var _sum = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode - && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.AskQty).Sum();//要货单要货数量 - var _currSum = db.V_TB_ASN_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode - && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum();//当前存在发货单数量 - var _curr = db.V_TB_ASN_DETAIL.Where(p => p.AsnBillNum == p_asn.AsnBillNum && p.PartCode == itm.PartCode - && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum(); - var _rejct = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == p_asn.AskBillNum && p.PartCode == itm.PartCode - && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false&&p.BillType==3).Select(p => p.Qty).ToList().Sum(); + var askdeail = db.TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.State != -1 && p.IsDeleted == false);//判断是否作废 + if (askdeail == null) + { + _ret.MessageList.Add(string.Format("要货看板{1}零件号{0}已经作废不能发货,请联系采购员确认!", itm.PartCode, itm.AskBillNum)); + } + //var _sum = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode + // && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.AskQty).Sum();//要货单要货数量 + //var _currSum = db.V_TB_ASN_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode + // && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum();//当前存在发货单数量 + //var _curr = db.V_TB_ASN_DETAIL.Where(p => p.AsnBillNum == p_asn.AsnBillNum && p.PartCode == itm.PartCode + // && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum(); + // var _rejct = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == p_asn.AskBillNum && p.PartCode == itm.PartCode + //&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false&&p.BillType==3).Select(p => p.Qty).ToList().Sum(); //if (_currSum - _curr + itm.Qty- Math.Abs(_rejct) <= _sum) //{ - TB_ASN_DETAIL _detail = new TB_ASN_DETAIL(); + TB_ASN_DETAIL _detail = new TB_ASN_DETAIL(); _detail.UID = itm.UID; _detail.UnConv = itm.UnConv; _detail.AsnBillNum = itm.AsnBillNum;