From ee7619dd020e21b2840a7dbbe040878ae1fc0054 Mon Sep 17 00:00:00 2001 From: qian Date: Mon, 7 Apr 2025 17:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E5=80=BC?= =?UTF-8?q?=206=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/SCP_PO_CONTROLLER.cs | 11 ++++++++--- Models/ScpEntities.cs | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Controller/SCP_PO_CONTROLLER.cs b/Controller/SCP_PO_CONTROLLER.cs index 11ff625..a4cbd06 100644 --- a/Controller/SCP_PO_CONTROLLER.cs +++ b/Controller/SCP_PO_CONTROLLER.cs @@ -9472,6 +9472,8 @@ namespace CK.SCP.Controller foreach (var itm in p_entitys) { var _entity = db.V_TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); + + var detail = db.TB_MAXPO_DETAIL.First(p => p.UID == itm.UID); if (Math.Abs( (itm.ReductionQty * 1000).Value) > _entity.SurplusQty) { _ret.MessageList.Add("零件号" + _entity.PartCode + "单次削减量不能大于剩余订货量(千克)"); @@ -9490,7 +9492,10 @@ namespace CK.SCP.Controller } else { - var detail = db.TB_MAXPO_DETAIL.First(p => p.UID == itm.UID); + + detail.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty.Value) * 1000; + //_entity.AsnQty = (itm.ReductionQty * 1000 + _entity.AsnQty).Value; + detail.SurplusQty = (itm.ReductionQty.Value * 1000 + detail.SurplusQty); if (detail.ReductionQtyOne == null) { detail.ReductionQtyOne = itm.ReductionQty; @@ -9514,9 +9519,9 @@ namespace CK.SCP.Controller list.Add(detail); } - _entity.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty).Value * 1000; + _entity.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty.Value) * 1000; //_entity.AsnQty = (itm.ReductionQty * 1000 + _entity.AsnQty).Value; - _entity.SurplusQty = (itm.ReductionQty * 1000 + _entity.SurplusQty).Value; + _entity.SurplusQty = (itm.ReductionQty * 1000 + detail.SurplusQty).Value; // 修改数据 TS_UNI_API maxuni = new TS_UNI_API(); maxuni.BillNum = _entity.PoBillNum; diff --git a/Models/ScpEntities.cs b/Models/ScpEntities.cs index f668ee3..c80a8fd 100644 --- a/Models/ScpEntities.cs +++ b/Models/ScpEntities.cs @@ -348,6 +348,9 @@ namespace CK.SCP.Models .HasPrecision(18, 6); modelBuilder.Entity() .Property(e => e.PoQty) +.HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.SurplusQty) .HasPrecision(18, 6); modelBuilder.Entity() .Property(e => e.ReductionQtyOne) @@ -364,6 +367,11 @@ namespace CK.SCP.Models modelBuilder.Entity() .Property(e => e.ReductionQtyFive) .HasPrecision(18, 6); + + modelBuilder.Entity() + .Property(e => e.SurplusQty).HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.OrderQtykg).HasPrecision(18, 6); } } }