From 292f5018b4b56738b74f14fa04b32784e68e47c0 Mon Sep 17 00:00:00 2001 From: qian Date: Fri, 22 Nov 2024 11:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 北京北汽/Controller/SCP_ASK_CONTROLLER.cs | 22 +++++++++++-------- .../Views/PlanData/SCP_INCOMPLETE_ASK.aspx | 4 ++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs index ad45120..59d516f 100644 --- a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs +++ b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs @@ -640,20 +640,24 @@ namespace CK.SCP.Controller if (p_list.Count > 0) { //var _detail = p_list[0]; - var asklist = p_list.Select(q => q.AskBillNum).ToList(); + var asklist = p_list.Select(q => q.AskBillNum).Distinct().ToList(); var arvdetail = db.TB_ARRIVE_DETAIL.Where(p => asklist.Contains(p.Remark) && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == 3).ToList(); - foreach (V_TB_INCOMPLETE_ASK _detail in p_list) + if (arvdetail.Count() > 0) { - - var reject = arvdetail.Where(p => p.Remark == _detail.AskBillNum).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { RejectSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode }); - reject.ToList().ForEach(itm => + foreach (V_TB_INCOMPLETE_ASK _detail in p_list) { - if (_detail.AskBillNum == itm.Remark && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode) + + var reject = arvdetail.Where(p => p.Remark == _detail.AskBillNum).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode }).Select(p => new { RejectSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode }); + reject.ToList().ForEach(itm => { - _detail.Number = _detail.Number + Math.Abs(itm.RejectSum); - } - }); + if (_detail.AskBillNum == itm.Remark && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode) + { + _detail.Number = _detail.Number + Math.Abs(itm.RejectSum); + } + }); + } } + } } diff --git a/北京北汽/SCP/Views/PlanData/SCP_INCOMPLETE_ASK.aspx b/北京北汽/SCP/Views/PlanData/SCP_INCOMPLETE_ASK.aspx index de4452a..78de9d0 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_INCOMPLETE_ASK.aspx +++ b/北京北汽/SCP/Views/PlanData/SCP_INCOMPLETE_ASK.aspx @@ -110,8 +110,8 @@ - - + +